<template>
  <div
    class="ui container layout-content"
    style="padding-top: 5em; margin-top: 15px;"
  >
    <ZuiNotificationModal v-on:send="send"></ZuiNotificationModal>
    <div class="ui stackable grid">
      <div class="column sixteen wide computer sixteen wide mobile">
        <div class="ui stackable grid">
          <div class="column eleven wide computer sixteen wide mobile">
            <div
              class="content"
              id="content"
            >
              <div
                class="ui segment raised news"
                id="latest-news"
                style=""
              >
                <sui-feed>
                  <sui-feed-event
                    v-for="event in events"
                    :key="event.key"
                    @click="toggleNotificationModal"
                  >
                    <sui-feed-label :image="event.image" />
                    <sui-feed-content>
                      <sui-feed-summary>
                        <a>{{event.executor}}</a> {{event.action}} on his page
                        <sui-feed-date :content="event.date" />
                      </sui-feed-summary>
                      <sui-feed-extra
                        text
                        :content="event.extraText"
                      />
                    </sui-feed-content>
                  </sui-feed-event>
                </sui-feed>
              </div>
            </div>
          </div>
          <div class="column five wide  computer only print hidden">
            <sui-card
              @click.native="shift('/personal')"
              style="cursor:pointer"
            >
              <sui-card-content :style="{backgroundImage: 'url(' + img + ')',}">
              </sui-card-content>
              <sui-card-content style="height: 65px;">
                <sui-image
                  :src="`${baseUrl}elliot.jpg`"
                  class="right floated"
                  circular
                />
                <sui-card-header style="margin-top: 0.5em;">Elliot Fu</sui-card-header>
                <sui-card-meta>Friends of Veronika</sui-card-meta>
              </sui-card-content>
              <sui-card-content
                extra
                style="height: 65px;"
              >
                <ul class="profile profile-stats">
                  <li
                    class="profile-card profile-arrange"
                    v-for=" n in 3"
                    :key="n"
                  >
                    <sui-statistic size="mini">
                      <sui-statistic-label style="margin-bottom:5px">
                        Saves
                      </sui-statistic-label>
                      <sui-statistic-value>
                        22
                      </sui-statistic-value>
                    </sui-statistic>
                  </li>
                </ul>
              </sui-card-content>
            </sui-card>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import location from "@/mixins/location";
import router from "@/mixins/router";
import { mapActions } from "vuex";
import socketio from "@/mixins/socketio";
import ZuiNotificationModal from "@/components/ZuiNotificationModal.vue";
// @ is an alias to /src
export default {
  name: "home",
  mixins: [location, router, socketio],
  components: {
    ZuiNotificationModal
  },
  data() {
    return {
      baseUrl: process.env.BASE_URL,
      img: require("@/assets/images/elliot.jpg"),
      events: [
        {
          executor: "Elliot Fu",
          content: "zasd",
          link: "",
          date: "1 Hour Ago",
          action: "posted",
          image: require("@/assets/images/elliot.jpg"),
          meta: {
            like: "4 Likes"
          },
          summary: "Elliot Fu added you as a friend"
        },
        {
          executor: "Helen Troy",
          link: "",
          date: "4 days ago",
          action: "posted",
          image: require("@/assets/images/elliot.jpg"),
          meta: {
            like: "1 Likes"
          },
          summary: "Helen Troy added 2 new illustrations",
          extraImages: [
            require("@/assets/images/elliot.jpg"),
            require("@/assets/images/elliot.jpg")
          ]
        },
        {
          executor: "Joe Henderson",
          link: "",
          date: "3 days ago",
          action: "posted",
          image: require("@/assets/images/elliot.jpg"),
          meta: {
            like: "8 Likes"
          },
          summary: "Joe Henderson posted on his page",
          extraText:
            "Ours is a life of constant reruns." +
            " We're always circling back to where we'd we started."
        },
        {
          executor: "Justen Kitsune",
          link: "",
          date: "4 days ago",
          action: "posted",
          image: "static/images/avatar/small/justen.jpg",
          meta: {
            like: "41 Likes"
          },
          summary: "Justen Kitsune added 2 new photos of you",
          extraText:
            "Look at these fun pics I found from a few years ago. Good times.",
          extraImages: [
            "static/images/wireframes/image.png",
            "static/images/wireframes/image-text.png"
          ]
        }
      ]
    };
  },
  mounted() {},
  methods: {
    ...mapActions(["toggleNotificationModal", "handleNotificationModal"])
  }
};
</script>
<style lang="less" scoped>
@tablet: 992px;
@mobile: 768px;
.layout-content {
  background-color: rgb(255, 255, 255);
  flex: auto;
  min-height: 0;
  margin: 0 auto;
}
.profile {
  box-sizing: border-box;
  display: table;
  margin: 10px 0 0 0;
  min-width: 100%;
  padding: 0;
  table-layout: auto;
}
.profile-stats {
  table-layout: fixed;
}
.profile-card {
  width: 1%;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  line-height: 1;
  overflow: hidden;
  transition: all 0.15s ease-in-out;
}
.profile-arrange {
  vertical-align: bottom;
  display: table-cell;
  padding: 0;
  vertical-align: top;
}
.ui.card > .content,
.ui.cards > .card > .content {
  &:active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 2px 4px rgba(152, 28, 235, 0.4);
  }
  background-size: 100%;
  height: 95px;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  background-position: 0 50%;
  width: 100%;
  padding: 0;
  margin-top: -1px;
}
.ui.right.floated.image,
.ui.right.floated.images {
  background-color: #fff;
  border-radius: 50%;
  margin: -25px 8px 0 0;
  padding: 1px;
  vertical-align: bottom;
  display: inline-block !important;
  max-width: 100%;
}
.ui.card .content img,
.ui.cards > .card .content img {
  border-radius: 50%;
  height: 72px;
  width: 72px;
  border: 2px solid #fff;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  color: #fff;
}
.ui.segment.raised.news {
  padding: 0;
}
.ui.feed {
  & /deep/ .event {
    padding: 1rem;
    border-bottom: 1px solid #e6ecf0;
    cursor: pointer;
    &:hover {
      background-color: #f5f8fa;
    }
  }
}
</style>
